Skip to content

ENH: Read from compressed data sources #11677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

khs26
Copy link

@khs26 khs26 commented Nov 22, 2015

This is the start of an effort to address compression in read_* methods (at the moment, just read_pickle, as per #11666. So far, I've factored out the compression handling in the _read function of pandas.io.parsers and used that in the pickling read routine.

Tests on the way, along with actual testing that it works, docs and (if we want), I can also put something similar in the other read_* methods too.

@@ -234,18 +234,28 @@ class ParserWarning(Warning):
fields if it is not spaces (e.g., '~').
""" % (_parser_params % _fwf_widths)

def get_compression(filepath_or_buffer, encoding, compression_kwd):
"""
Determine the compression type of a file or buffer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this entire function to pandas.io.common; call it maybe get_compression_type.

This should be a bit more lightweight as you can see there are already other functions which use the compression. This will simply infer from a keywork and/or file extension and return the type of compression. Which can then be passed to other routines.

@jreback jreback added Enhancement IO Data IO issues that don't fit into a more specific label Compat pandas objects compatability with Numpy or Python functions labels Nov 23, 2015
@@ -31,7 +31,7 @@ New features
Other enhancements
^^^^^^^^^^^^^^^^^^


- `read_pickle` can now unpickle from compressed files (:issue:`<num>`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add in the actual number here (11666)

@jreback
Copy link
Contributor

jreback commented Dec 6, 2015

needs some tests

@jreback
Copy link
Contributor

jreback commented Dec 16, 2015

can you add some tests and upate

@jreback
Copy link
Contributor

jreback commented Jan 2, 2016

@khs26 can you update

1 similar comment
@jreback
Copy link
Contributor

jreback commented Jan 11, 2016

@khs26 can you update

@jreback
Copy link
Contributor

jreback commented Jan 20, 2016

closing but pls reopen if you wish to continue working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Enhancement IO Data IO issues that don't fit into a more specific label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants